<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta content="" name="description" />
    <meta content="webthemez" name="author" />
    <meta http-equiv="pragram" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache, must-revalidate">
    <meta http-equiv="expires" content="0">

    <title>Bootstrap Admin Template</title>
    <!-- Bootstrap Styles-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
    <link href="assets/css/select2.min.css" rel="stylesheet" >
    <link href="assets/css/checkbox3.min.css" rel="stylesheet" >
    <!-- Custom Styles-->
    <link href="assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
<div id="page-wrapper">

    <div class="header">
        <h1 class="page-header">
            评分
        </h1>

    </div>


    <div id="page-inner">

        <div class="row">
            <div class="col-md-12">
                <!-- Advanced Tables -->
                <div class="panel panel-default">
                    <div class="panel-heading">
                        评分
                    </div>
                    <div class="panel-body">
                        <div class="table-responsive">
                            <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline" role="grid">
                                <div class="row"><div class="col-sm-6"><div class="dataTables_length" id="dataTables-example_length">



                                </div></div><div class="col-sm-6"><div id="dataTables-example_filter" class="dataTables_filter">

                                </div></div></div><table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables" aria-describedby="dataTables-example_info">



                                <thead>
                                <tr role="row">
                                    <th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column ascending" style="width: 79.6667px;">学生姓名</th>
                                    <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 43.6667px;">评分</th>
                                </tr>
                                </thead>
                                <tbody id="data">


                                </tbody>
                            </table>

                            </div>
                        </div>
                        <!--End Advanced Tables -->
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                        <h4 class="modal-title" id="myModalLabel">评分</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" id="form">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span style="color:red">*</span>成绩</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="grade" placeholder="" width="30px">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span style="color:red">*</span>答辩类别</label>
                                <div class="col-sm-10">
                                    <div class="radio3 radio-check radio-inline">
                                        <input type="radio" id="radio4" name="radio" value="true" checked="">
                                        <label for="radio4">
                                            通过
                                        </label>
                                    </div>
                                    <div class="radio3 radio-check radio-success radio-inline">
                                        <input type="radio" id="radio5" name="radio" value="false">
                                        <label for="radio5">
                                            不通过
                                        </label>
                                    </div>

                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <input type="button" class="btn btn-default" onclick="ugrade()" data-dismiss="modal" value="确定"/>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
                    </div>
                </div>
            </div>
        </div>

        <!--<script type="text/javascript">-->
        <!--function showdialog(){-->
        <!--$('#myModal').modal();-->
        <!--}-->
        <!--</script>-->
        <!-- /. WRAPPER  -->
        <!-- JS Scripts-->
        <!-- jQuery Js -->
        <script src="assets/js/jquery-1.10.2.js"></script>
        <!-- Bootstrap Js -->
        <script src="assets/js/bootstrap.min.js"></script>
        <!-- Metis Menu Js -->
        <script src="assets/js/jquery.metisMenu.js"></script>
        <!-- Custom Js -->

        <!--ajax-->
        <script src="assets/js/jQuery-2.1.4.min.js"></script>
        <script src="assets/js/util.js"></script>
        <script src="assets/js/pageGroup.js"></script>
<script>
    var user= JSON.parse(sessionStorage.getItem("user"));//将json转换为对象
    var id=user.id;
    show();
    function show() {
        var tid=id;
        var r = getResponse('/group/listMyStu/'+tid+'/0');
        console.log(r);
        tmp='';
        for(var i=0;i<r.responseJSON.length;i++){
            tmp+='<tr>'
            +'<td class="center">'+r.responseJSON[i].realname+'</td>'
            +'<td class="center"><a href="#" class="btn btn-success" onclick="showd(\''+r.responseJSON[i].id+'\')" data-toggle="modal" data-target="#myModal">打分</a></td>'
            +'</tr>'
        }
        document.getElementById("data").innerHTML=tmp;
    }
    var sid;
    function showd(id){
            sid=id;
    }
    function ugrade(){
        alert(sid);
        var formData=new FormData();
        var flag=document.getElementsByName("radio")[0].checked;
        alert(flag);
        formData.append("grade",document.getElementById('grade').value);
        formData.append("isPass",flag);
        var re=getResponse("/group/audit/"+sid+'?grade='+document.getElementById('grade').value+'&isPass='+flag);
    }

</script>


</body>
</html>
